<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="main2"/>
    <g:set var="entityName"
    value="${message(code: 'workflowEvent.label', default: 'workflowEvent')}"/>
    <title>编辑阶段事件</title>
</head>

<body>
    <div class="main-body">
        <div class="page-wrapper">
            <div class="page-header">
                <div class="page-header-title">
                    <h4>编辑阶段事件</h4>
                </div>
                <div class="page-header-breadcrumb">
                    <ul class="breadcrumb-title">
                        <li class="breadcrumb-item">
                            <a href="/salesDashboard/index">
                                <i class="icofont icofont-home"></i>
                            </a>
                        </li>
                        <li class="breadcrumb-item">
                            <g:link controller="workflowStage" action="show" id="${this.workflowEvent?.stage?.id}">工作流阶段</g:link>
                        </li>
                        <li class="breadcrumb-item">编辑阶段事件</li>
                    </ul>
                </div>
            </div>
            <div class="page-body">
                <g:if test="${flash.message}">
                <div class="message" role="status">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${this.workflowEvent}">
            <ul class="errors" role="alert">
                <g:eachError bean="${this.workflowEvent}" var="error">
                <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                    error="${error}"/></li>
                </g:eachError>
            </ul>
        </g:hasErrors>

        <div class="card">
            <div class="card-header">
                <h5>编辑阶段事件</h5>
                <div class="card-header-right">
                    <i class="icofont icofont-rounded-down"></i>
                </div>
            </div>
            <div class="card-block">
                <g:form resource="${this.workflowEvent}" method="PUT" class="form-horizontal flowForm">


                <div class="form-group row">
                    <label class="col-md-2 control-label">执行次序</label>

                    <div class="col-md-3">
                        <input type="hidden" name="stage.id" value="${this.workflowEvent?.stage?.id}">
                        <g:textField name="executeSequence"
                        value="${this.workflowEvent?.executeSequence}"
                        class="form-control"/>
                    </div>
                    
                    <label class="col-md-2 control-label">组件</label>

                    <div class="col-md-3">


                        <g:select class="form-control" name="component.id" id="component"
                        value="${this.workflowEvent?.component?.id}"
                        from="${this.componentList}" optionKey="id" optionValue="name"
                        noSelection="['': '请选择']"></g:select>

                    </div>
                </div>

                <div class="form-group row">
                    <label class="col-md-2 control-label">同步执行</label>

                    <div class="col-md-3">
                        <input type="hidden" value="${this.workflowEvent?.isSynchronous}" id="active">
                        <div class="radio radio-info radio-inline">
                            <input type="radio" name="isSynchronous" value="true" checked="" id="radio1">
                            <label for="radio1">true</label>
                        </div>

                        <div class="radio radio-info radio-inline">
                            <input type="radio" name="isSynchronous" value="false" id="radio2">
                            <label for="radio2">false</label>
                        </div>
                    </div>
                </div>


                <div class="form-group row">
                    <div class="col-md-12">
                        <button class="submitBtn btn btn-info" type="submit">保存</button>
                    </div>
                </div>
            </g:form>

        </div>
    </div>
</div>
</div>
</div>


<script>
    $(function () {
        if ($("#active").val() == "true") {
            $("#radio1")[0].checked = true;
        } else {
            $("#radio2")[0].checked = true;
        }
    })
</script>
</body>
</html>
